<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

</head>

<body>
        <div class="clockdiv">
            <canvas id="clock" width="200px" height="200px">您的浏览器不兼容canvas</canvas><div><!-- 圆形时钟 -->  
     
    <div id="jsCode">

    </div>
    <div id="jsTimeBox">
00:00:00
    </div>
    <a href="http:www.baidu.com?name=test#hahlele"></a>

    <div id="box">
        <ul>
            <li>01</li>
            <li>02</li>
            <li>03</li>
        </ul>
        <div>内容1</div>
        <div>内容2</div>
        <div>内容3</div>
    </div>
    <script src="https://common.cnblogs.com/scripts/jquery-2.2.0.min.js"></script>
    <script src="./RoundClock.js"></script>
    <script>
        var codeBox = document.getElementById("jsCode");
        var areaStr = "0123456789qwertyuiopadfklhjgfdsacbnmQWERTYUIOPADFKLHJGFDSACBNM";
        var result = "";
        for (var i = 0; i < 4; i++) {
            var ran = Math.round(Math.random() * 61);
            if (result.toLowerCase().indexOf(areaStr[ran]) < 0) {
                result += areaStr.charAt(ran);
            } else i--;

        }
        console.log(result);

        // 倒计时

        var timeBox = document.getElementById("jsTimeBox");

        function computed() {
            var nowTime = new Date(),
                targetTime = new Date("2019/8/31 17:00:00");
            var spanTime = targetTime - nowTime; //毫秒差
            if (spanTime <= 0) {
                timeBox.innerHTML = "开始抢购";
                return;
            }
            var hour = Math.floor(spanTime / (1000 * 60 * 60));
            spanTime -= hour * 60 * 60 * 1000;
            var minute = Math.floor(spanTime / (1000 * 60));
            spanTime -= minute * 60 * 1000;
            var second = Math.floor(spanTime / 1000);
            //不足十位补0
            hour<10?hour="0"+hour:hour;
            minute<10?minute="0"+minute:minute;
            second<10?second="0"+second:second;
            timeBox.innerHTML = hour + ":" + minute + ":" + second;
        }
        setInterval(computed,1000);

        //输出a
        var link=document.getElementsByTagName("a")[0];
        console.dir(link);
        console.log(link.search.toString(1).substring(1));
    </script>
</body>

</html>